Internet communications are primarily carried out using the internet protocol suite. Generally speaking, the internet protocol suite is a networking model that defines hierarchical layers that each perform a specific function to send and/or receive data. Typically, the layers include an application layer, a transport layer, an internet layer, and a link layer. When an application running on one computer desires to send data to an application on another computer, the sending application employs an application layer protocol (e.g., HTTP, WebSocket, SMTP, RDP, FTP, SSH, etc.) to structure the data in a format that the receiving application will understand. The application then passes this “application layer” data down to the transport layer which will further format the data. Typically, the transport layer employs the transmission control protocol (TCP) or the user datagram protocol (UDP) which create TCP or UDP packets containing the application layer data. These packets are then passed down to the internet layer which typically employs the internet protocol (IP) to encapsulate the TCP or UDP packets into IP packets. These IP packets are then passed down to the link layer which implements a link layer protocol to physically transport the packets over the network to the intended recipient.
Because of the hierarchical structure of the internet protocol suite, in order for an application to communicate over the internet, the application only needs to be able to create appropriately formatted application layer data (e.g., SMTP formatted data if the application is an email client or server) and then send such data to the transport layer. Typically, the operating system provides an API to allow an application to create a socket (e.g., a TCP socket or UDP socket) over which the application can send application layer data to and receive application layer data from the underlying transport layer. Because of this abstraction, it can be relatively easy to create applications that can communicate with a remote application using any application layer protocol.
Recently, however, there has been a movement towards implementing applications that are browser-based. One reason for this movement is that most devices have a browser that provides a uniform environment (e.g., a JavaScript-based environment) in which the applications can run which is largely independent of the underlying operating system. In other words, it is now common to design applications to be run within the browser (hereinafter browser-based applications).
In addition to the ubiquitous nature of the browser, another benefit of browser-based applications is that they are executed in a sandbox. A sandbox is a controlled environment which restricts the application's access to potentially risky functionality of the underlying operating system.
However, this added security also limits what a browser-based application can do. For example, it is not possible for a browser-based application (including a webpage) to directly access the transport layer. For example, an application written in JavaScript (which is the primarily language used to develop browser-based applications) cannot directly write to or read from a TCP or UDP socket. Instead, the application will be limited to using one of a few application layer protocols to send and receive data over the internet. For example, the application could employ HTTP GET or HTTP POST requests to transmit data to a remote server. Alternatively, the application could employ the WebSocket protocol.
FIG. 1 illustrates an example computing environment 100 in which a client device 101 having a browser 102 that executes a browser-based application 103 communicates via an internet connection 120 with an application 111 executing on a server 110. Because application 103 executes within browser 102, application 103 will be limited to the functionality provided by browser 102 including being limited to communicating with application 111 using only the application layer protocols supported by browser 102. If the application layer protocol employed by application 111 is not supported by browser 102, browser-based application 103 will not be able to communicate with application 111.
Accordingly, because of these limitations on the application layer protocols that are available for use by a browser-based application, or, in other words, because a browser-based application cannot directly communicate with the transport layer, many applications cannot be implemented as browser-based applications. For example, a remote desktop application, which may require use of the remote desktop protocol (or similar remote display protocol) to communicate with the server side application (e.g., a remote desktop server), cannot be implemented as a browser-based application since the remote desktop protocol is an application layer protocol that is not supported by the browser.